package com.smartthinking.cypqro;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import android.os.Bundle;
import android.view.Window;

public class MapaDetallles extends android.support.v4.app.FragmentActivity{

	private GoogleMap mapa = null;
	String poi_lat, poi_lng;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.mapadetalles);

		Bundle extras1 = getIntent().getExtras();
		poi_lat = extras1.getString("querr2");
		poi_lng = extras1.getString("querr3");
//		poi_lat = extras1.getString("mapa1");
//		poi_lng = extras1.getString("mapa2");

		mapa = ((SupportMapFragment) getSupportFragmentManager()
				.findFragmentById(R.id.map)).getMap();

		if (mapa != null) 
		{
			mapa.addMarker(new MarkerOptions().position(new LatLng(Double.parseDouble(poi_lat),Double.parseDouble(poi_lng))));
			mapa.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(Double.parseDouble(poi_lat),Double.parseDouble(poi_lng)), 15));
		}
	}
}
